home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / WillowWisp.dxr / Internal_12_fairy queen.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.1 KB  |  40 lines

  1. property pSprite, spriteNum, pLocation, pRotation, pInc, pWow
  2.  
  3. on beginSprite me
  4.   pSprite = sprite(spriteNum)
  5.   pLocation = [float(pSprite.locH), float(pSprite.locV)]
  6.   pRotation = 0
  7.   pInc = 25
  8.   pWow = 1.57000000000000006
  9. end
  10.  
  11. on enterFrame me
  12.   if not pSprite.flipH then
  13.     pRotation = pRotation + pInc
  14.     xPos = pWow
  15.     yPos = sin(pRotation * PI / 180) * 5.5
  16.     pLocation = pLocation + [xPos, yPos]
  17.     pSprite.loc = point(pLocation[1], pLocation[2])
  18.     if pSprite.locH > ((the stage).rect.width + pSprite.width) then
  19.       pWow = pWow * -1
  20.       pSprite.flipH = not pSprite.flipH
  21.       pSprite.locV = random(440)
  22.       pLocation = [float(pSprite.locH), float(pSprite.locV)]
  23.     end if
  24.   else
  25.     if pSprite.flipH then
  26.       pRotation = pRotation + pInc
  27.       xPos = pWow
  28.       yPos = sin(pRotation * PI / 180) * 5.5
  29.       pLocation = pLocation + [xPos, yPos]
  30.       pSprite.loc = point(pLocation[1], pLocation[2])
  31.       if pSprite.locH < (0 - pSprite.width) then
  32.         pWow = pWow * -1
  33.         pSprite.flipH = not pSprite.flipH
  34.         pSprite.locV = random(440)
  35.         pLocation = [float(pSprite.locH), float(pSprite.locV)]
  36.       end if
  37.     end if
  38.   end if
  39. end
  40.